package com.dc.free.interceptor;

import com.dc.free.controller.BaseController;
import com.dc.free.db.model.CUser;
import com.dc.free.util.WebUtil;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class CharityInterceptor implements Interceptor {
	
	@Override
	public void intercept(Invocation inv) {
		BaseController baseController = (BaseController) inv.getController();
		CUser user = baseController.getUser();
		
		if(user == null) {
			baseController.renderStatus(111111, "", WebUtil.getPath(baseController.getRequest()) + "/charity/login#/login");
			return;
		}
		
		inv.invoke();
	}

}
